#include "server.h"
#include <iostream>

ServerEndpoint::ServerEndpoint(const std::string& address) {
    context = zmq::context_t();
    socket = zmq::socket_t(context, zmq::socket_type::rep);
    socket.bind(address);
}

void ServerEndpoint::receiveRequest() {
    zmq::message_t request;
    socket.recv(request, zmq::recv_flags::none);
    std::cout << "Received request: " << request.to_string() << std::endl;
}

void ServerEndpoint::sendReply(const std::string& reply) {
    socket.send(zmq::buffer(reply), zmq::send_flags::none);
    std::cout << "Sent reply: " << reply << std::endl;
}
